feat(terminal): add auto_insert option to preserve scroll position#233
Merged
Conversation
1020fb5 to
6857f8b
Compare
When switching back to the Claude Code terminal from the editor, the terminal auto-enters insert mode and scrolls to the bottom, losing the user's reading position. Add `terminal.auto_insert` config option (default: true) that when set to false, keeps the terminal in normal mode and preserves the scroll position. Closes coder#232 Signed-off-by: Thomas Kosiewski <tk@coder.com>
Supporting changes for the terminal.auto_insert feature (coder#232, coder#145): - README: document terminal.auto_insert (note that false also opens the terminal in Normal mode, since it gates start-insert too) - CHANGELOG: add [Unreleased] entry - types.lua: annotate ClaudeCodeTerminalConfig.auto_insert - fixtures/issue-232 + scripts/repro_issue_232.lua: env-selectable reproduction (snacks reproduces, native is the baseline) plus a headless regression harness that asserts the auto-insert BufEnter autocmd is absent when auto_insert=false Change-Id: I155f9896ba32a8522344e07b016e9e0854c41d9b Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Thomas Kosiewski <tk@coder.com>
6857f8b to
02afddb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
terminal.auto_insertconfig option (default:true) that controls whether the terminal auto-enters insert mode when focusedfalse, switching back to the Claude Code terminal preserves the scroll position instead of jumping to the bottomUsage
Test plan
auto_insertconfig validationCloses #232